// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 2e5+50, MOD = 1e9+7;

vector<LL> dpf[N];
LL dps[N];

vector<int> G[N];
int n;


int siz[N], sf[N];

LL ans[N];

inline LL bin(LL a, LL b, LL p=MOD) {
    LL res = 1;
    for (a%=p; b; b>>=1, a=a*a%p)
        if (b & 1)
            res = res * a % p;
    return res;
}


LL f[N], invf[N];
inline void init() {

    f[0] = invf[0] = 1;
    for (int i=1; i<N; ++i)
        f[i] = f[i-1] * i % MOD;
    invf[N-1] = bin(f[N-1], MOD-2, MOD);
    for (int i=N-2; i>=1; --i)
        invf[i] = invf[i+1] * (i+1) % MOD;

}

LL C(int n, int m) {
    if (n < m || n < 0 || m < 0)
        return 0;
    return f[n] * invf[m] % MOD * invf[n-m] % MOD;
}

inline LL inv(LL x) { return bin(x, MOD-2, MOD);}

void dfs(int u, int fa) {
    siz[u] = 0;
    dps[u] = 1;
    for (int v : G[u]) {
        if (v == fa)
            continue;
        dfs(v, u);
        siz[u] += siz[v];
        LL c = C(siz[u], siz[v]) * dps[v] % MOD;

        dps[u] = dps[u] * c % MOD;
    }

    for (int v : G[u]) {
        if (v == fa)
            continue;
        dpf[u].push_back(dps[u] * inv(C(siz[u], siz[v])) % MOD * inv(dps[v]) % MOD);
    }
    ++siz[u];
    sf[u] = n - siz[u];
}

void dfs2(int u, int fa, LL la) {
    ans[u] = C(n-1, sf[u]) * la % MOD * dps[u] % MOD;
    int now = 0;
    for (int v : G[u]) {
        if (v == fa)
            continue;
        LL c = dpf[u][now++];
        dfs2(v, u, c * la % MOD * C(n-1-siz[v], sf[u]) % MOD);
        // ++now;
    }
}

int main(int argc, char const *argv[]) {
    init();
    // code
    scanf("%d", &n);
    for (int i=0; i<n-1; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        G[u].push_back(v);
        G[v].push_back(u);
    }
    dfs(1, 1);
    // for (int i=1; i<=n; ++i)
    //     dbg(i, dps[i]);
    dfs2(1, 1, 1);
    for (int i=1; i<=n; ++i)
        printf("%lld\n", ans[i]);
    return 0;
}
